home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.02 Feb 95 / Yenta / Erics C++ Libraries / Interface Classes / CPPControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-04  |  1.6 KB  |  64 lines  |  [TEXT/KAHL]

  1. /********************************************************* DEFINITION
  2.     DATE:    9/23/93
  3.     AUTHOR: Eric R. Rosé
  4.     
  5.     CLASS:  CPPControl
  6.     
  7.     SUPERCLASS: CPPVisualObject
  8.     
  9.         This C++ class provides an abstract superclass for a 
  10.             generic control
  11.     
  12. ********************************************************************/
  13.  
  14. #pragma once
  15.  
  16. #include <CPPVisualObject.h>
  17.  
  18.  
  19. class CPPControl : public CPPVisualObject {
  20. public:
  21.             CPPControl (CPPWindow *itsWindow, short ResID,
  22.                          Boolean isFramed = FALSE,
  23.                          Boolean canBeTarget = FALSE,
  24.                          Boolean active = FALSE, Boolean visible = TRUE);
  25.             CPPControl (CPPWindow *itsWindow, Rect *itsBounds,
  26.                          short ControlType, StringPtr itsText,
  27.                          Boolean isFramed = FALSE,
  28.                          Boolean useWindowFont = FALSE,
  29.                          Boolean canBeTarget = FALSE,
  30.                          Boolean active = FALSE, Boolean visible = TRUE);
  31.             ~CPPControl (void);
  32.  
  33.     virtual    char     *ClassName (void);
  34.     
  35.     virtual    Boolean    DoClick (EventRecord *theEvent);
  36.  
  37.     virtual    void    Activate (Boolean nowActive);
  38.     virtual    void    MakeVisible (Boolean nowVisible);
  39.     virtual    void    Draw (void);
  40.     
  41.     virtual    void    SetValue (short newValue);
  42.             short    GetValue (void);
  43.             void    SetCallBack (ProcPtr callBack);
  44.     
  45.             Boolean    IsEnabled(void);
  46.     virtual    void    DoOnClick (void);
  47.     virtual    void    FrameControl (Boolean useRoundRect);
  48.     virtual    void    EnableControl (Boolean nowEnabled);
  49.  
  50.     virtual    Rect    *GetBounds (void);
  51.  
  52. protected:
  53.     Boolean            isEnabled;
  54.     Boolean            hasFrame;
  55.     short            myValue;
  56.     ControlHandle    theControl;
  57.     ProcPtr            callBackProc;
  58.  
  59.     virtual    void    MoveContent (short newH, short newV);
  60.     virtual    void    ResizeContent (short newWidth, short newHeight);
  61.  
  62. };
  63.  
  64.